﻿/*********************弘石项目三组************************
*  功能描述：系统设置-机构设置
*  作者：黄启轩
*  时间：2020-12-08
*  修改人：黄启轩
*  修改时间：2020-12-08
*********************弘石项目三组************************/

using Hong.Business.Business_SystemSettings;
using Hong.Model.SysDomain.Model_SystemSettings;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;



namespace WeHongshibApI.Controllers.XControllers_SystemSettings
{
    [ApiExplorerSettings(GroupName = "SystemSettings")]
    [Route("api/[controller]/")]
    [ApiController]

   
    public class InstitutionalsettingController : ControllerBase
    {
        #region 构造器API注入
        private readonly Institutionalsetting _institutionalsetting;
        public InstitutionalsettingController(Institutionalsetting institutionalsetting)
        {
            _institutionalsetting = institutionalsetting;
        }

        #endregion

        #region 部门管理

        #region 部门加载
        [HttpGet, Route("GetDep")]
        public async Task<IActionResult> GetDep(string DepName, int pageindex, int pagesize)
        {
            var result = await _institutionalsetting.GetDep(DepName, pageindex, pagesize);
            return Ok(result);
        }
        #endregion

        #region 部门添加
        [HttpPost, Route("AddUser")]
        public async Task<IActionResult> AddDep(Department department)
        { 
            var result=await _institutionalsetting.AddDep(department);
            return Ok(result);
        }

        #endregion

        #region 加载部门下拉列表
        [HttpGet,Route("selecDep")]
        public async Task<IActionResult> selecDep()
        { 
            var result=await _institutionalsetting.selecDep();
            return Ok(result);
        }

        #endregion

        #region 公共查询字典表
        [HttpGet, Route("selecDic")]
        public async Task<IActionResult> selecDic(string DicCode)
        { 
            var result=await _institutionalsetting.selecDic(DicCode);
            return Ok(result);
        }
        #endregion

        #endregion
    }



}
